<%--
  Created by IntelliJ IDEA.
  User: 123
  Date: 2024/6/27
  Time: 19:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="qin.com.Users" %>

<%@ page import="java.util.*" %>

<%@ page import="qin.com.DataConnection" %>
<%@ page import="qin.com.ChengJi" %>

<html>

<head>

    <title>Title</title>

</head>

<body>

<%

    //获取从selectuser.jsp传送过来的id,是要进行更新的记录id

    int id=Integer.parseInt(request.getParameter("id"));

    //查询要修改用户的信息

    String sql="select id,name,java,jsp,oracle from chengji where id=?";

    //给命令中的参数赋值

    Object[] para=new Object[]{id};

    //调用数据库类的方法获取要更新的用户信息

    List<ChengJi> list=new DataConnection<ChengJi>().query(ChengJi.class,sql,para);

%>

<h2>更新用户</h2>

<form action="newuusers.jsp" method="post">

    <input type="hidden" name="id" value="<%=id%>">

    <br/>name:<input type="text" name="name" value="<%=list.get(0).getName()%>">

    <br/>java:<input type="text" name="java" value="<%=list.get(0).getJava()%>">
    <br/>jsp:<input type="text" name="jsp" value="<%=list.get(0).getJsp()%>">
    <br/>oracle:<input type="text" name="oracle" value="<%=list.get(0).getOracle()%>">

    <br/><input type="submit" value="更新">  <input type="reset" value="重置">

</form>

</body>

</html>